package com.example.beautymakeup.dao;


import com.example.beautymakeup.pojo.Banner;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BannerDao {
    @Select("select * from banner where status = 0;")
    List<Banner> get();

    @Select("select * from banner limit #{page},#{size};")
    List<Banner> getAll(@Param("page") int page, @Param("size") int size);

    @Update("update banner set bannerTitle = #{bannerTitle},bannerImage = #{bannerImage} where uid = #{uid};")
    int update(Banner banner);

    @Insert("insert into banner(bannerTitle,bannerImage) values (#{bannerTitle},#{bannerImage});")
    int add(Banner banner);

    @Select("select count(*) from banner where status = 0;")
    int getCount();

    @Select("select count(*) from banner;")
    int getAllCount();

    @Update("update banner set status = #{status} where uid = #{uid};")
    int ban(Banner banner);

    @Delete("delete from banner where uid = #{uid};")
    int delete(Banner banner);
}
